// @ts-nocheck
import prompt from '@system.prompt';
import router from '@system.router';

export default {
    data: {
        activeTabIndex: 0,
        tabAttr: [
            {
                icon: "/common/icon/home.png",
                activeIcon: "/common/icon/home-active.png",
                name: "首页",
            },
            {
                icon: "/common/icon/types.png",
                activeIcon: "/common/icon/types-active.png",
                name: "分类",
            },
            {
                icon: "/common/icon/shop-cart.png",
                activeIcon: "/common/icon/shop-cart-active.png",
                name: "购物车",
            },
            {
                icon: "/common/icon/my.png",
                activeIcon: "/common/icon/my-active.png",
                name: "我的",
            }
        ],
    },
    onInit() {

    },
    onShow() {
        var message = router.getParams().message
        if (message != undefined) {
            prompt.showToast({
                message: message
            })
        }
    },
    tabChange(event) {
        this.activeTabIndex = (event.index == undefined) ? event.detail.id : event.index
        this.onShow()
    },
}
